import service from "@/util/request.js";


// 手机密码登录
export function login(data = {}) {
	return service.request({
		url: '/login/cellphone',
		method: 'GET',
		params: data,
	})
}
// 发送验证码
export function sentCaptcha(phone) {
	return service.request({
		url: '/captcha/sent',
		method: 'GET',
		params: {phone: phone},
	})
}

// 验证验证码
export function verifyCaptcha(data = {}) {
	return service.request({
		url: '/captcha/verify',
		method: 'GET',
		params: data,
	})
}
// 手机号密码注册
export function cellphoneRegister(data = {}) {
	return service.request({
		url: '/register/cellphone',
		method: 'GET',
		params: data,
	})
}

// 检查手机号是否存在
export function checkCellphoneExistence(phone = {}) {
	return service.request({
		url: '/cellphone/existence/check',
		method: 'GET',
		params: {phone: phone},
	})
}

// 登录状态
export function loginStatus() {
	return service.request({
		url: '/login/status',
		method: 'GET',
		params: {},
	})
}

// 获取用户信息
export function getUserDetail(userId) {
	return service.request({
		url: '/user/detail',
		method: 'GET',
		params: {uid: userId},
	})
}

// 退出登录
export function logout() {
	return service.request({
		url: '/logout',
		method: 'GET',
		params: {},
	})
}
